<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <table id="outer">
        <tr>
            <td>1001</td>
            <td>李烈</td>
        </tr>
        <tr>
            <td>1002</td>
            <td>李木子</td>
        </tr>
    </table>
    <script>
        //根据table - 获取具体的某个tr
        var outer = document.getElementById("outer");

        //获取的id="outer"下的所有的标签名是tr的,返回的也是一个数组
        var trs = outer.getElementsByTagName("tr");
        //alert(trs.length);
        //获取outer下的子标签
        var trs_childs = outer.children;//数组 - 包含了tbody
        //alert(trs_childs.length);//1 - tbody实际上还是存在的
        var trs_all = trs_childs[0].children;
        alert(trs_all.length);

    </script>
</body>

</html>